home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc International / Development / TSMTEsample⁄1.1 / Source / TempFocus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-14  |  1.4 KB  |  65 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        TempFocus.h
  3.  
  4.     Contains:    Stack-based utility classes for requesting and releasing foci.
  5.  
  6.     Written by:    Troy Gaul
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11.  
  12. #ifndef _TEMPFOCUS_
  13. #define _TEMPFOCUS_
  14.  
  15. //------------------------------------------------------------------------------
  16. // Forward declarations
  17. //------------------------------------------------------------------------------
  18.  
  19. struct Environment;
  20. class ODFrame;
  21.  
  22. //------------------------------------------------------------------------------
  23. // TempFocus
  24. //------------------------------------------------------------------------------
  25.  
  26. class TempFocus : Destructo {
  27.  
  28. public:
  29.     TempFocus(Environment*, ODTypeToken focusType, ODFrame*);
  30.     ~TempFocus();
  31.     
  32.     ODBoolean Request();
  33.     
  34. protected:
  35.     TempFocus(Environment*, ODFrame*);
  36.         // Can be used by subclasses to defer setting the type of
  37.         // the focus until inside its constructor.
  38.  
  39. private: // disallow these:
  40.     TempFocus(const TempFocus&);
  41.     void operator=(const TempFocus&);
  42.     
  43. protected:
  44.     ODTypeToken     fFocusType;
  45.  
  46. private:
  47.     Environment* fEv;
  48.     ODFrame*     fFrameToFocus;
  49.     ODBoolean     fAcquired;
  50. };
  51.  
  52. //------------------------------------------------------------------------------
  53. // TempClipboardFocus
  54. //------------------------------------------------------------------------------
  55.  
  56. class TempClipboardFocus : public TempFocus {
  57.  
  58. public:
  59.     TempClipboardFocus(Environment*, ODFrame*);
  60. };
  61.  
  62. #endif
  63.  
  64.  
  65.